
public class TravelInsurance {
	
	private String companyName;
	private int policyNumber;
	
	
	TravelInsurance(){
		
		
		companyName = null;
		policyNumber = 0;
		
		
	}
	
	
	TravelInsurance(String companyNameIn, String policyNumberIn)
	{
		
		
		if(policyNumberIn.length() > 10){
			
			throw new IllegalArgumentException();
			
		}
		
		policyNumber = Integer.parseInt(policyNumberIn);
		companyName = companyNameIn;
	}
	
	
	
	public void setCompanyName(String companyNameIn)
	{
		companyName = companyNameIn;
		
		
	}
	
	
	
	public String getCompanyName(){
		
		return companyName;
	}
	
	
	public void  setPolicyNumber(String policyNumberIn) throws IllegalArgumentException{
		
		if(policyNumberIn.length() > 10){
			
			throw new IllegalArgumentException();
			
		}
		
		policyNumber = Integer.parseInt(policyNumberIn);
		
		
	}
	
	
	public int getPolicyNumber(){
		
		return policyNumber;
	}
	
	
	public boolean equals(Object object){
		
		if(object instanceof TravelInsurance){
			
			TravelInsurance travelInsurance = (TravelInsurance) object;
			
			return (getCompanyName().equals(travelInsurance.getCompanyName())
					&& getPolicyNumber() == travelInsurance.getPolicyNumber());
			
			
			
			
		}
		
		return false;
	}
	
	
}
